<?php


class SelectShopPromos extends Connection {
	private $conn;
	public $stocks_number;



	public function __construct() {
		Connection::init();
		$this->conn = $this->getConnection();
	}


	public function extractShopPromos($id){
		$stmt = $this->conn->prepare("	SELECT s.name, p.promo,s.producer
													FROM shop_stock_promo p
													join stock s
														on (s.id = p.stock_id)
													WHERE p.shop_id =?");
		$stmt->bindValue(1, (int)$id, PDO::PARAM_INT);
		$stmt->execute();
		return $stmt->fetchAll(PDO::FETCH_ASSOC);
	}
}
?>